<template>
    <el-select v-model="modelValue" style="width: 240px">
        <el-option v-for="option in options" :key="option.code" :label="option.name" :value="option.code">
        </el-option>
    </el-select>
</template>

<script lang="ts" setup>
import { getOptions } from '@/api/application'
import type { ApplicationOption } from '@/api/application/types'

// interface Props {
//     value: string
// }

// const props = withDefaults(defineProps<Props>(), {
//     value: ''
// })

const modelValue = defineModel({
    type: String,
    required: true
})

const options = ref<ApplicationOption[]>()

onMounted(async () => {
    options.value = await getOptions()
})

</script>